Skip to content

feat(models): choose the folder models are kept in, from Storage (2.21.1) - #45

Merged
nodemode-ai merged 6 commits into
mainfrom
feat/models-folder
Nov 30, 2026
Merged

nodemode-ai merged 6 commits into
mainfrom
feat/models-folder

Conversation

@nodemode-ai

Copy link
Copy Markdown
Collaborator

feat(models): choose the folder models are kept in, from Storage (2.21.1)

Summary

For issue #43, its first part. The second part, a voice app on this computer through the OpenAI-compatible speech API, follows in its own pull request. Built on main at 2.21.0 (pull request #44).

  • The problem. The installed app kept every model in its data folder, on the system drive on Windows (%LOCALAPPDATA%\formcut\models). FORMCUT_MODELS_DIR could move them, but only from the environment, which an installed app gives a person no way to set.
  • Storage, on the home screen. A line shows the models folder and the free space on its drive. Choose models folder opens the system's folder dialog, Use the default folder goes back, and Copy downloaded models copies what is already downloaded into the new folder with progress. A change applies after formcut restarts, and the line says so.
  • What follows a chosen folder. Every model the app downloads, the Pocket TTS and Chatterbox downloads, and the speech runtime when it is next set up. A speech runtime already in the data folder keeps working from there.
  • Safe by default. The folder must be absolute, outside the data folder and writable. A folder that already holds other files gets formcut-models inside it. The copy writes each file through a .part name, keeps files already there at the same size, keeps links as links, checks the free space first, and removes nothing. A chosen folder that cannot be reached at start (a drive not plugged in) falls back to the default for that run.
  • FORMCUT_MODELS_DIR still wins when it is set, and the buttons are then off.
  • Routes. GET /api/storage gains models; PUT /api/storage/models-folder; POST /api/storage/models-folder/copy (a job).
  • Strings in English, German, Spanish, Arabic, Persian, Hebrew and Croatian. The wiki's Models page, example.env, both HASHOUT logs and the skill's engine map are updated.

Commits

Oldest first; the release commit is last; no merge commits. The short hashes change when the commits are signed.

  • feat(models): a person can choose the folder models are kept in, from the next start
  • feat(storage): Choose models folder, Use the default folder and Copy downloaded models
  • docs(models): where models are kept, and choosing another folder from Storage
  • i18n: the models folder strings in Arabic, Persian, Hebrew and Croatian
  • docs(skills): the engine map lists storage.py's three routes
  • chore(release): 2.21.1, a person can choose the folder models are kept in, from Storage

Version

v2.21.1 (release commit is last). Bumped from 2.21.0, the same sites as 2.20.2: the README badge, backend/app/main.py APP_VERSION, form-functions.json, frontend/package.json, frontend/package-lock.json (both fields), src-tauri/Cargo.toml, src-tauri/Cargo.lock and src-tauri/tauri.conf.json. The two new HASHOUT entries are stamped 2.21.1. The demo bundles are not rebuilt.

Checks

Run on 30 November 2026, Linux, Python 3.12, Node 22, on this tree:

  • ruff check and ruff format --check clean; setup/notices.py --check passes; setup/skill_maps.py --check in step.
  • npm audit 0 vulnerabilities; tsc --noEmit clean; npm run build built; the locale key counts match.
  • python -m pytest tests: 1,745 passed, 154 skipped, no failures. The window smoke tests in frontend/tests/window: 6 passed. No tests were added.
  • The engine code driven against a scratch data folder across two starts: the three refusals, the nested formcut-models, a copy and a second copy that keeps every file, the chosen folder in use after the restart with the voice downloads following it, the default again, and the refusal when FORMCUT_MODELS_DIR is set.
  • The Storage view in headless Chromium at 4x CPU and a slow network, against a scratch engine on this tree: the line, the three buttons' states before and after a folder is set, a copy that lands the file, and the default again, with no layout shift and no page error. The folder dialog cannot open headless, so the folder was sent with the same request the button sends.

Not run: Windows and macOS, the Windows folder dialog, a real second drive, a drive unplugged at start, a copy of tens of gigabytes, the golden frames and output checks (the renderer is not touched).

Merging

Merge with a merge commit so each commit and its signature stays. Do not squash.

… the next start

The installed app kept every model in the data folder, on the system drive on
Windows (issue 43). The engine now takes the models folder from
FORMCUT_MODELS_DIR, else from models-folder.json in the data folder, else the
default; a chosen folder that cannot be reached at start falls back to the
default for that run. With a chosen folder the Pocket TTS and Chatterbox
downloads and a new speech runtime go there too; an existing runtime in the
data folder keeps working.

GET /api/storage reports the folder, where it comes from and what applies after
a restart. PUT /api/storage/models-folder checks the path is absolute, outside
the data folder and writable, and nests formcut-models in a folder that already
holds other files. POST /api/storage/models-folder/copy copies what is already
downloaded as a job, file by file through .part names, and removes nothing.

Seen: driven against a scratch data folder across two engine starts. Not run:
Windows, a real second drive.
…downloaded models

The home screen's Storage view shows the models folder and the free space on its
drive, and says when a change applies after a restart or when
FORMCUT_MODELS_DIR fixes it. Three chips choose a folder with the system dialog,
go back to the default, and copy the downloaded models with progress. The line
and the chips are made once and patched in place. Strings in English, German
and Spanish.

Seen: tsc --noEmit, npm run build, and the view in headless Chromium at 4x CPU
and a slow network with no layout shift. Not seen: the Tauri window or Windows'
folder dialog.
The four locales that ship as files carry every English string; the eleven home.models strings of the Storage view are added to each. Seen: tests/test_runtime_locales.py.
The generated inventory in engine-map.md, as setup/skill_maps.py writes it. Seen: setup/skill_maps.py --check.
@nodemode-ai
nodemode-ai requested a review from gbarnai as a code owner November 30, 2026 23:42
@nodemode-ai
nodemode-ai merged commit 5baadf7 into main Nov 30, 2026
8 checks passed
@nodemode-ai
nodemode-ai deleted the feat/models-folder branch November 30, 2026 23:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant